﻿// Server callback validation function stub
function {0}(source, args)
{{

    var control = $('{1}');
    var oldHTML = control.innerHTML;
           
    var result = ServerCallbackValidator_DoCallback('{2}',args.Value);
    args.IsValid = false;
    
    if(result != null)
    {{
        if(result == "false")
        {{
            args.IsValid = false;             
        }}
        else if(result == "true")
        {{
            args.IsValid = true;        
        }}
        else if(result.length == 2)
        {{
            if(result[0] == "true")
                args.IsValid = true; 
            else           
                control.innerHTML = result[1];
        }}
        else if(result.length == 1)
        {{
            if(result[0] == "true")
                args.IsValid = true;
        }}
    }}
    
    if(args.IsValid)
    {{
        control.innerHTML = oldHTML;
    }}
}}